// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import axios from './axios'
import Mint from 'mint-ui'
import 'mint-ui/lib/style.css'
import { Toast,Indicator} from 'mint-ui'
import store from './store/index'
import  filters from './filter'
import './assets/css/base.css'
for (var key in filters){
   Vue.filter(key, filters[key])
}

Vue.use(Mint)
Vue.config.productionTip = false
Vue.prototype.$toast = Toast
Vue.prototype.$loading = Indicator
// 挂载AXIOS原型
Vue.prototype.axios = axios

// 挂载封装请求
// 此处可自己封装请求


// Vue.prototype.Apost = function (data, cb) {
//   var data = Object.assign({
//     appid:1,
//     token:'eb86fa064482989312e2a1557ddb4032',
//   },data)
//   var data1 = new FormData()
//   for(var key in data){
//     data1.append(key, data[key])
//   }
//   this.axios.post('',data1).then(resu => {
//     var res = resu.data
//     if (Number(res.code) === 101) {
//       this.$toast({
//         message: '此操作需要登陆',
//         duration: 3000
//       })
//       this.$store.state.user = {}
//       window.clearLocal('ate_user')
//       this.$router.push('/upl/login')
//       return cb('此操作需要登陆',res)
//     }
//     if(Number(res.code === 0)){
//       return cb(null,res)
//     }else{
//       this.$toast({
//         message: res.error_msg,
//         duration: 3000
//       })
//       return cb(res.error_msg,res)
//     }
//   }).catch(err=>{
//     this.$toast({
//       message: '网络错误',
//       duration: 3000
//     })
//     cb('网络错误',err)
//   })
// }

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  store,
  components: { App },
  template: '<App/>',

})

